#include "SymptomBuilder.h"


SymptomBuilder::SymptomBuilder(QObject* parent, const QString & unitName, const QStringList& elementNames)
{
	this->parent = parent;
	//this->addSymptomGroup(unitName);
	this->buildGroup(unitName,elementNames);
}

SymptomBuilder::SymptomBuilder(QObject* parent)
{
	this->parent = parent;
}

SymptomGroup* SymptomBuilder::addSymptomGroup(const QString & name)
{
	if(this->nameSymptomGroupMap.value(name))
		return 0;
	SymptomGroup* group = new SymptomGroup(this,name);
	this->nameSymptomGroupMap.insert(name,group);
	return group;
}

SymptomBuilder* SymptomBuilder::buildGroup(const QString& groupName, const QStringList& elementNames)
{
	if(this->nameSymptomGroupMap.value(groupName))
		return this;
	SymptomGroup* group = new SymptomGroup(this,groupName);
	group->buildGroup(elementNames);
	this->nameSymptomGroupMap.insert(groupName,group);
	return this;
}

SymptomBuilder::~SymptomBuilder(void)
{
}
